<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<style>
@font-face {
    font-family: foo;
    src: url(file:///no-such-font.ttf);
}
</style>

<script>
description('Unloaded web fonts should not report Resource Timing');

window.jsTestIsAsync = true;

function getDocumentFontFaces() {
    var faces = [];
    document.fonts.forEach(function(face) { faces.push(face); });
    return faces;
}

function verify() {
    shouldBeEqualToString('getDocumentFontFaces()[0].status', 'unloaded');
    entries = performance.getEntriesByName('file:///no-such-font.ttf');
    shouldBe('entries.length', '0');
    finishJSTest();
}

if (location.hash == '#check') {
    setTimeout(verify, 10);
} else {
    location.hash = 'check';
    location.reload();
}
</script>
